/**
 * Created by HTWX on 2018/3/15.
 */
var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req,res,next) {
    if(req.cookies.submits=='Y')
    {
          res.redirect('/result');
    }
    else {
        next();
    }
});

router.get('/', function(req,res,next) {
    if(req.cookies.report!='')
    {
        res.redirect('/getready');
    }else {
        next();
    }
});

router.get('/', function(req, res) {
    res.render('top', {
        title: '医药考试',
        username:req.cookies.username,
        credentials:req.cookies.credentials,
        admincard:req.cookies.admincard,
        papername:req.cookies.papername,
        papercount:req.cookies.papercount,
        paperscore:req.cookies.paperscore
    });
});

module.exports = router;